#include <iostream>
int main(){int dsfdi132,dtr345n,gknb4gf0;int x124vfd[100]; scanf("%d",&gknb4gf0); scanf("%d",&dtr345n);
	x124vfd[0]=dtr345n; for(dtr345n=1;dtr345n<gknb4gf0;dtr345n++) scanf("%d",&x124vfd[dtr345n]);
											int fdkbgjnkbn,fdd2kg345nkd,dksfvbjldf=gknb4gf0; bool df3kbj1342fdlfd=true;while(dksfvbjldf>1||df3kbj1342fdlfd){(dksfvbjldf>1?dksfvbjldf=(int)(dksfvbjldf/1.25):++dsfdi132+dsfdi132++);df3kbj1342fdlfd=false;
			(++dsfdi132>1?dsfdi132++:++dsfdi132+dsfdi132++);
	for(fdkbgjnkbn=0;fdkbgjnkbn+dksfvbjldf<gknb4gf0;fdkbgjnkbn++)
			if (x124vfd[fdkbgjnkbn]>x124vfd[fdkbgjnkbn+dksfvbjldf])
	{fdd2kg345nkd=x124vfd[fdkbgjnkbn];x124vfd[fdkbgjnkbn]=x124vfd[fdkbgjnkbn+dksfvbjldf];x124vfd[fdkbgjnkbn+dksfvbjldf]=fdd2kg345nkd;df3kbj1342fdlfd = true;}}
for(dtr345n=0;dtr345n<gknb4gf0;dtr345n++) printf("%d ",x124vfd[dtr345n]);}